<template>
	<view class="item" @click="onDetail(item)">
		<view class="option">
			<view class="title">{{ current==0?item.signUnit_dictText?item.signUnit_dictText:'--':item.signUnitName?item.signUnitName: '--' }}</view>
		</view>
		<view class="option">
			<view class="lf">{{ current==0?'申请日期': '立项日期' }}</view>
			<view class="rl">{{ current==0?item.createTime?item.createTime:'--':item.projectEstablishDate?item.projectEstablishDate: '--' }}</view>
		</view>
		<view class="option" v-if="current==0">
			<view class="lf">申请部门</view>
			<view class="rl">{{ item.proposerDeptId_dictText?item.proposerDeptId_dictText: '--' }}</view>
		</view>
		<view class="option" v-else>
			<view class="lf">业务分类</view>
			<view class="rl">{{ item.categoryName?item.categoryName: '--' }}</view>
		</view>
		<view class="option">
			<view class="lf">项目名称</view>
			<view class="rl">{{ item.projectName }}</view>
		</view>
		<view class="option">
			<view class="lf">{{ current==0?'档案编号': '项目档案编号' }}</view>
			<view class="rl">{{ current==0?item.finalNo?item.finalNo:'--':item.projectFinalNo?item.projectFinalNo: '--' }}</view>
		</view>
		<view class="option">
			<view class="lf">经营团队</view>
			<view class="rl">{{ current==0?item.teamName_dictText?item.teamName_dictText:'--':item.teamName?item.teamName: '--' }}</view>
		</view>
		
		<view class="collapse_content" :style="{ maxHeight: screenShow?200 + 'px':0 }">
			<view class="option">
				<view class="lf">项目承接人</view>
				<view class="rl">{{ current==0?item.undertaker_dictText?item.undertaker_dictText:'--':item.undertakerName?item.undertakerName: '--' }}</view>
			</view>
			<view class="option">
				<view class="lf">项目归属年度</view>
				<view class="rl">{{ current==0?item.year_dictText?item.year_dictText:'--':item.year?item.year: '--' }}</view>
			</view>
			<view class="option">
				<view class="lf">业主单位</view>
				<view class="rl">{{ current==0?item.ownerUnit_dictText?item.ownerUnit_dictText:'--':item.ownerUnitName?item.ownerUnitName: '--' }}</view>
			</view>
			<template v-if="current == 0">
				<view class="option">
					<view class="lf">联系人</view>
					<view class="rl">{{ item.contacts_dictText?item.contacts_dictText:'--' }}</view>
				</view>
				<view class="option">
					<view class="lf">联系方式</view>
					<view class="rl">{{ item.contactTel?item.contactTel:'--' }}</view>
				</view>
				<view class="option">
					<view class="lf">预计合同额(元)</view>
					<view class="rl">{{ item.estimatedContractAmount?item.estimatedContractAmount: '--' }}</view>
				</view>
			</template>
			<template v-else>
				<view class="option">
					<view class="lf">项目状态</view>
					<view class="rl">{{ item.changeStatus_dictText?item.changeStatus_dictText:'--' }}</view>
				</view>
				<view class="option">
					<view class="lf">项目归档状态</view>
					<view class="rl">{{ item.projectFileStatus_dictText?item.projectFileStatus_dictText:'--' }}</view>
				</view>
				<view class="option">
					<view class="lf">合同状态</view>
					<view class="rl">{{ item.contractStatus_dictText?item.contractStatus_dictText: '--' }}</view>
				</view>
			</template>
		</view>
		<view class="wrap" @click.stop="counterTrial(item)">
			<u-icon name="arrow-down" :class="!screenShow?'right-icon':'right-icon-transform'" color="#C6C6C6" size="20"></u-icon>
		</view>
	</view>
</template>
<script>
	export default {
		props: {
			item: {
				type: [Object],
				default: () => {}
			},
			current: {
				type: [Number, String],
				default: -1
			}
		},
		onReady() {
			// 获取高度
		},
		data() {
			return {
				screenShow: false
			}
		},
		methods: {
			counterTrial () {
				this.screenShow = !this.screenShow
			},
			
			onDetail (item) {
				this.$emit('click', item)
			}
		}
	}
</script>

<style lang="scss" scoped>
@import url("@/assets/inputStyle.scss");

.item {
	width: 100%;
	.option {
		margin-bottom: 8rpx;
		.lf {
			font-size: 14px;
		}
		.title{
			font-size: 16px;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #333333;
			line-height: 22px;
		}
	}
	.wrap {
		margin-top: 16rpx;
		display: flex;
		font-size: 14px;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #1E6FFF;
		border-top: 1rpx solid #E5E5E5;
		display: flex;
		justify-content: center;
		align-items: center;
		height: 80rpx;
	}
	
	.right-icon{
		transition: transform 0.5s;
		-moz-transition: -moz-transform 0.5s; /* Firefox 4 */
		-webkit-transition: -webkit-transform 0.5s; /* Safari 和 Chrome */
		-o-transition: -o-transform 0.5s;
		transform: rotate(180deg);
		-webkit-transform: rotate(0deg);
		-moz-transform: rotate(0deg);
		-o-transform: rotate(0deg);
	}
	.right-icon-transform{
		transition: transform 0.5s;
		-moz-transition: -moz-transform 0.5s; /* Firefox 4 */
		-webkit-transition: -webkit-transform 0.5s; /* Safari 和 Chrome */
		-o-transition: -o-transform 0.5s;
		transform: rotate(180deg);
		-webkit-transform: rotate(180deg);
		-moz-transform: rotate(180deg);
		-o-transform: rotate(180deg);
	}
	
	.collapse_content {
		transition: max-height .4s ease-in-out, -webkit-transform .4s ease-in-out, transform .4s ease-in-out;
		transform-origin: 50% 50% 0px;
		overflow: hidden;
	}
}
</style>